package org.jeecg.modules.oms.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.jeecg.common.aspect.annotation.Dict;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 半成品销售订单表
 */
@Data
@TableName("oms_semi_product_sales_order")
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value = "SemiProductSalesOrder对象", description = "半成品销售订单表")
public class SemiProductSalesOrder implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    /**
     * 主键ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @ApiModelProperty(value = "主键ID")
    private String id;
    
    /**
     * 订单编号
     */
    @Excel(name = "订单编号", width = 15)
    @ApiModelProperty(value = "订单编号")
    private String orderNo;
    
    /**
     * 客户ID
     */
    @ApiModelProperty(value = "客户ID")
    private String customerId;
    
    /**
     * 客户名称
     */
    @Excel(name = "客户名称", width = 15)
    @TableField(exist = false)
    @ApiModelProperty(value = "客户名称")
    private String customerName;
    
    /**
     * 客户编码
     */
    @Excel(name = "客户编码", width = 15)
    @TableField(exist = false)
    @ApiModelProperty(value = "客户编码")
    private String customerCode;
    
    /**
     * 客户省份
     */
    @Excel(name = "客户省份", width = 15)
    @TableField(exist = false)
    @ApiModelProperty(value = "客户省份")
    private String customerProvince;
    
    /**
     * 客户城市
     */
    @Excel(name = "客户城市", width = 15)
    @TableField(exist = false)
    @ApiModelProperty(value = "客户城市")
    private String customerCity;
    
    /**
     * 客户区县
     */
    @Excel(name = "客户区县", width = 15)
    @TableField(exist = false)
    @ApiModelProperty(value = "客户区县")
    private String customerDistrict;
    
    /**
     * 工程ID
     */
    @ApiModelProperty(value = "工程ID")
    private String projectId;
    
    /**
     * 工程名称
     */
    @Excel(name = "工程名称", width = 20)
    @TableField(exist = false)
    @ApiModelProperty(value = "工程名称")
    private String projectName;
    
    /**
     * 工程省份
     */
    @Excel(name = "工程省份", width = 15)
    @TableField(exist = false)
    @ApiModelProperty(value = "工程省份")
    private String projectProvince;
    
    /**
     * 工程城市
     */
    @Excel(name = "工程城市", width = 15)
    @TableField(exist = false)
    @ApiModelProperty(value = "工程城市")
    private String projectCity;
    
    /**
     * 工程区县
     */
    @Excel(name = "工程区县", width = 15)
    @TableField(exist = false)
    @ApiModelProperty(value = "工程区县")
    private String projectDistrict;
    
    /**
     * 下单日期
     */
    @Excel(name = "下单日期", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "下单日期")
    private Date orderDate;
    
    /**
     * 交付日期
     */
    @Excel(name = "交付日期", width = 15, format = "yyyy-MM-dd")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "交付日期")
    private Date deliveryDate;
    
    /**
     * 销售负责人ID
     */
    @ApiModelProperty(value = "销售负责人ID")
    private String salesPersonId;
    
    /**
     * 销售负责人姓名
     */
    @Excel(name = "销售负责人", width = 15)
    @TableField(exist = false)
    @ApiModelProperty(value = "销售负责人姓名")
    private String salesPersonName;
    
    /**
     * 订单总金额
     */
    @Excel(name = "订单总金额", width = 15)
    @ApiModelProperty(value = "订单总金额")
    private BigDecimal totalAmount;
    
    /**
     * 预付款
     */
    @Excel(name = "预付款", width = 15)
    @ApiModelProperty(value = "预付款")
    private BigDecimal prepayment;
    
    /**
     * 已付款金额
     */
    @Excel(name = "已付款金额", width = 15)
    @ApiModelProperty(value = "已付款金额")
    private BigDecimal paidAmount;
    
    /**
     * 未付款金额
     */
    @Excel(name = "未付款金额", width = 15)
    @ApiModelProperty(value = "未付款金额")
    private BigDecimal unpaidAmount;
    
    /**
     * 付款状态（0-未付清，1-已付清）
     */
    @Excel(name = "付款状态", width = 15, dicCode = "pay_status")
    @Dict(dicCode = "pay_status")
    @ApiModelProperty(value = "付款状态")
    private Integer payStatus;
    
    /**
     * 支付凭证
     */
    @ApiModelProperty(value = "支付凭证")
    private String paymentVoucher;
    
    /**
     * 成本汇总
     */
    @Excel(name = "成本汇总", width = 15)
    @ApiModelProperty(value = "成本汇总")
    private BigDecimal totalCost;
    
    /**
     * 销售利润
     */
    @Excel(name = "销售利润", width = 15)
    @ApiModelProperty(value = "销售利润")
    private BigDecimal profit;
    
    /**
     * 订单状态（0待审核 1审核通过-待上传 2已上传汇总单-待上传优化单 3已上传优化单-待提交审核 4待下发 5领料单待审核 6待领料 7生产中 8已完成 9已驳回 10已入库 11已发货）
     */
    @Excel(name = "订单状态", width = 15, dicCode = "order_status")
    @Dict(dicCode = "order_status")
    @ApiModelProperty(value = "订单状态")
    private Integer status;
    
    /**
     * 订单描述
     */
    @Excel(name = "订单描述", width = 20)
    @ApiModelProperty(value = "订单描述")
    private String description;
    
    /**
     * 备注
     */
    @Excel(name = "备注", width = 20)
    @ApiModelProperty(value = "备注")
    private String remark;
    
    /**
     * 创建人
     */
    @ApiModelProperty(value = "创建人")
    private String createBy;
    
    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "创建时间")
    private Date createTime;
    
    /**
     * 更新人
     */
    @ApiModelProperty(value = "更新人")
    private String updateBy;
    
    /**
     * 更新时间
     */
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ApiModelProperty(value = "更新时间")
    private Date updateTime;
    
    /**
     * 删除标识（0-正常,1-已删除）
     */
    @ApiModelProperty(value = "删除标识")
    private Integer delFlag;
    
    /**
     * 租户ID
     */
    @ApiModelProperty(value = "租户ID")
    private Integer tenantId;
    
    // ========== 关联查询字段（不持久化到数据库） ==========

    
    /**
     * 项目联系人
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "项目联系人")
    private String projectContactPerson;
    
    /**
     * 项目联系电话
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "项目联系电话")
    private String projectContactPhone;
    
    /**
     * 项目地址
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "项目地址")
    private String projectAddress;
    
    /**
     * 项目金额
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "项目金额")
    private BigDecimal projectAmount;
    
    /**
     * 项目状态
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "项目状态")
    private Integer projectStatus;
    
    /**
     * 项目描述
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "项目描述")
    private String projectDescription;
}
